package com.hnd.springframework.beans.factory.support;

import com.hnd.springframework.core.io.DefaultResourceLoader;
import com.hnd.springframework.core.io.Resource;
import com.hnd.springframework.core.io.ResourceLoader;

/**
 * 负责获取资源
 */
public abstract class AbstractBeanDefinitionReader implements BeanDefinitionReader {
    private  ResourceLoader resourceLoader;
    private final BeanDefinitionRegistry registry;

    public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry) {
        this(new DefaultResourceLoader(),registry);
    }

    public AbstractBeanDefinitionReader(ResourceLoader resourceLoader, BeanDefinitionRegistry registry) {
        this.resourceLoader = resourceLoader;
        this.registry = registry;
    }

    @Override
    public BeanDefinitionRegistry getRegistry() {
        return registry;
    }

    @Override
    public ResourceLoader getResourceLoader() {
        return resourceLoader;
    }
}
